﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DTO;
using DAO;
namespace BUS
{
    public class MatHangBUS
    {
        public List<MatHangDTO> LayDanhSachMatHang()
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LayDSMH();
        }
        public List<MatHangDTO> LayDanhSachTenMatHang()
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LayDanhSachTenMatHang();
        }
        public List<XuatXuDTO> LayXuatXuTheoMatHang(int maMH)
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LayXuatXuTheoMatHang(maMH);
        }
        public int LaySoLuongTheoMatHang(int maMH, int maXX)
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LaySoLuongTheoMatHang(maMH, maXX);
        }
        public double LayGiaTheoMatHang(int maMH, int maXX)
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LayGiaTheoMatHang(maMH, maXX);
        }
        public string LayTenMatHangTheoMa(int maMH)
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LayTenMatHangTheoMa(maMH);
        }
        public int LayMaMatHangTheoTen(string ten)
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.LayMaMatHangTheoTen(ten);
        }
        public string CapNhatSoLuong(int maMH, int maXX, int soluong, bool err)
        {
            MatHangDAO mhDAO = new MatHangDAO();
            return mhDAO.CapNhatSoLuong(maMH, maXX, soluong, err);
        }

    }
}
